<?php
include 'conf/db-config.php';
include 'submitemail.php';
$txtEmailId = $_REQUEST['txtEmailId'];

$admin_mail_id = "admin@topmbaconsultant.com";

if(strlen($txtEmailId)>0)
{
	$sqlSelect = "select user_name, password FROM login_detail WHERE email='".$txtEmailId."'";
	$run2 = mysql_query($sqlSelect);
	while ($data = mysql_fetch_array($run2))
	{
		$user_name = $data['user_name'];
		$password = $data['password'];
	}
	
  		$message ="Hi $user_name,\n";
  		$message .="Your Login Details are: \n";
  		$message .="Your User Name :$user_name  \n";
  		$message .="Your Current Password :$password  \n";
  		
  		$newMsg = GENERATE_SMTP_MAIL($txtEmailId,$admin_mail_id,"My MBA Website",'','','You have registered Successfully',$message);
  		if(strlen($password)>0)
  		{
  			$message = "success";
  		}
  		if(strlen($password)==0)
  		{
  			$message = "failure";
  		}
	
	?>
	<script>window.open('forgot-password.php?message=<?php echo $message; ?>','_self');</script>
	<?php 
}

